<?php

namespace App\Criteria\Student\Relation;

use Illuminate\Support\Facades\Input;
use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;

class StudentRelationBaseQueryCriteria implements CriteriaInterface{

    public function apply($model, RepositoryInterface $repository){
        $student_id=Input::get('student_id');
        if($student_id){
            $model=$model->where('student_id','=',$student_id);
        }
        $model->orderBy('id','desc');
        return $model;
    }
}
